
    var img_url = 'http://admin.chinlingcloud.com/';
    var action_url = 'http://admin.chinlingcloud.com/index/index/';
    var Url = "https://program.chinlingcloud.com/index.php/api/v2/";
    var tokenk = document.getElementById('token_user').value;
    var storage = window.localStorage;
    var storageSe = window.sessionStorage;

    function getUrlParam(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
        var r = window.location.search.substr(1).match(reg); //匹配目标参数
        if (r != null) return decodeURI(r[2]);
        return null; //返回参数值
    }

//显示加载数据
    function showDiv() {
        $("#loading").show();
    }

//隐藏加载数据
    function hiddenDiv() {
        $("#loading").hide();
    }

// str 为qq号码


    function taostr(str, timer) {
        var htmlStr = '<div id="taostr" style="width:2.4rem;height:32px;position: fixed;left: 0;right:0;top: 0;bottom:0;margin:auto;z-index: 100000000000;">'
            + '<div style="width:2rem;min-height:32px;text-align:center;padding:0.2rem;line-height: 0.32rem;font-size: 0.24rem;background: rgba(0,0,0,0.6);color: #EEEEEE;border-radius: 5px;">' + str + '</div>'
            + '</div>'
        $("body").append(htmlStr);
        window.setTimeout(function () {
            $("#taostr").remove()
        }, timer);
    }

    function randomString(len) {
        var $chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678';
        /****默认去掉了容易混淆的字符oOLl,9gq,Vv,Uu,I1****/
        var maxPos = $chars.length;
        var pwd = '';
        for (i = 0; i < len; i++) {
            pwd += $chars.charAt(Math.floor(Math.random() * maxPos));
        }
        return pwd;
    }
    function failure(status) {
        if (status == "timeout")
        {
            taostr("请求超时",1000)
        }
    }
    function slideUp(obj, offset, callback) {
        var start,
            end,
            isLock = false,//是否锁定整个操作
            isCanDo = false,//是否移动滑块
            isTouchPad = (/hp-tablet/gi).test(navigator.appVersion),
            hasTouch = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) && !isTouchPad;
        //将对象转换为jquery的对象
        obj = $(obj);
        var objparent = obj.parent();
        var fn =
            {
                //移动容器
                translate: function (diff) {
                    obj.css({
                        "-webkit-transform": "translate(0," + diff + "px)",
                        "transform": "translate(0," + diff + "px)"
                    });
                },
                //设置效果时间
                setTranslition: function (time) {
                    obj.css({
                        "-webkit-transition": "all " + time + "s",
                        "transition": "all " + time + "s"
                    });
                },
                //返回到初始位置
                backup: function () {
                    fn.translate(0);
                    //标识操作完成
                    isLock = false;
                    $("#upPull").hide()
                }
            };
        //滑动开始
        obj.bind("touchstart", function (e) {
            var scrollPos;
            if (typeof window.pageYOffset != 'undefined') {
                scrollPos = window.pageYOffset;
            }
            else if (typeof document.compatMode != 'undefined' && document.compatMode != 'BackCompat') {
                scrollPos = document.documentElement.scrollTop;
            }
            else if (typeof document.body != 'undefined') {
                scrollPos = document.body.scrollTop;
            }
            if (scrollPos >= $(document).height() - $(window).height() && !isLock) {
                var even = typeof event == "undefined" ? e : event;
                //标识操作进行中
                isLock = true;
                isCanDo = true;
                //保存当前鼠标Y坐标
                start = hasTouch ? even.touches[0].pageY : even.pageY;
                //console.log(e.pageY)
                //消除滑块动画时间
                fn.setTranslition(0);
            }
        });
        //滑动中
        obj.bind("touchmove", function (e) {
            var scrollPos;
            if (typeof window.pageYOffset != 'undefined') {
                scrollPos = window.pageYOffset;
            }
            else if (typeof document.compatMode != 'undefined' && document.compatMode != 'BackCompat') {
                scrollPos = document.documentElement.scrollTop;
            }
            else if (typeof document.body != 'undefined') {
                scrollPos = document.body.scrollTop;
            }
            if (scrollPos >= $(document).height() - $(window).height() && isCanDo) {
                var even = typeof event == "undefined" ? e : event;
                //保存当前鼠标Y坐标
                end = hasTouch ? even.touches[0].pageY : even.pageY;
                //console.log(e)
                //console.log(end)
                if (start > end) {
                    $("#upPull").show().children("span").text("上拉加载")
                    even.preventDefault();
                    //消除滑块动画时间
                    fn.setTranslition(0.5);
                    //移动滑块
                    fn.translate(end - start - offset);
                }
            }
        });
        //滑动结束
        obj.bind("touchend", function (e) {
            if (isCanDo) {
                isCanDo = false;
                //判断滑动距离是否大于等于指定值
                if (start - end >= offset) {
                    var scrollPos;
                    if (typeof window.pageYOffset != 'undefined') {
                        scrollPos = window.pageYOffset;
                    }
                    else if (typeof document.compatMode != 'undefined' && document.compatMode != 'BackCompat') {
                        scrollPos = document.documentElement.scrollTop;
                    }
                    else if (typeof document.body != 'undefined') {
                        scrollPos = document.body.scrollTop;
                    }
                    if (scrollPos >= $(document).height() - $(window).height()) {
                        $("#upPull").show().children("span").text("正在加载")
                        //设置滑块回弹时间
                        fn.setTranslition(1);
                        //保留提示部分
                        fn.translate(-offset * 3);
                        //执行回调函数
                        if (typeof callback == "function") {
                            callback.call(fn, e);
                        }
                    }
                } else {
                    //返回初始状态
                    fn.backup();
                }
            }
        });
    }

    function slideDown(obj, offset, callback) {
        var start,
            end,
            isLock = false,//是否锁定整个操作
            isCanDo = false,//是否移动滑块
            isTouchPad = (/hp-tablet/gi).test(navigator.appVersion),
            hasTouch = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) && !isTouchPad;
        //将对象转换为jquery的对象
        obj = $(obj);
        console.log(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent))
        var objparent = obj.parent();
        var fn =
            {
                //移动容器
                translate: function (diff) {
                    obj.css({
                        "-webkit-transform": "translate(0," + diff + "px)",
                        "transform": "translate(0," + diff + "px)"
                    });
                },
                //设置效果时间
                setTranslition: function (time) {
                    obj.css({
                        "-webkit-transition": "all " + time + "s",
                        "transition": "all " + time + "s"
                    });
                },
                //返回到初始位置
                back: function () {
                    fn.translate(0);
                    //标识操作完成
                    isLock = false;
                    $("#downPull").hide()
                }
            };
        //滑动开始
        obj.bind("touchstart", function (e) {
            var scrollPos;
            if (typeof window.pageYOffset != 'undefined') {
                scrollPos = window.pageYOffset;
            }
            else if (typeof document.compatMode != 'undefined' && document.compatMode != 'BackCompat') {
                scrollPos = document.documentElement.scrollTop;
            }
            else if (typeof document.body != 'undefined') {
                scrollPos = document.body.scrollTop;
            }
            if ( scrollPos<= 0 && isLock) {
                var even = typeof event == "undefined" ? e : event;
                //标识操作进行中
                isLock = true;
                isCanDo = true;
                //保存当前鼠标Y坐标
                start = hasTouch ? even.touches[0].pageY : even.pageY;
                //console.log(e.pageY)
                //消除滑块动画时间
                fn.setTranslition(0);
            }
        });
        //滑动中
        obj.bind("touchmove", function (e) {
            var scrollPos;
            if (typeof window.pageYOffset != 'undefined') {
                scrollPos = window.pageYOffset;
            }
            else if (typeof document.compatMode != 'undefined' && document.compatMode != 'BackCompat') {
                scrollPos = document.documentElement.scrollTop;
            }
            else if (typeof document.body != 'undefined') {
                scrollPos = document.body.scrollTop;
            }
            if ( scrollPos<= 0 && isCanDo) {
                var even = typeof event == "undefined" ? e : event;
                //保存当前鼠标Y坐标
                end = hasTouch ? even.touches[0].pageY : even.pageY;
                //console.log("hasTouch:++++++"+hasTouch)
                //console.log("even.touches[0].pageY:++++++"+even.touches[0].pageY )
                //console.log("even.pageY:++++++++"+even.pageY)
                //console.log(even)
                //console.log("end:++++++"+end)
                if (start < end) {
                    //移动滑块
                        $("#downPull").show().children("span").text("下拉刷新")
                        even.preventDefault();
                        //消除滑块动画时间
                        fn.setTranslition(0);
                        fn.translate(end - start);
                }
            }
        });
        //滑动结束
        obj.bind("touchend", function (e) {
            if (isCanDo) {
                isCanDo = false;
                //判断滑动距离是否大于等于指定值
                if (end - start >= offset) {
                    //保留提示部分
                    var scrollPos;
                    if (typeof window.pageYOffset != 'undefined') {
                        scrollPos = window.pageYOffset;
                    }
                    else if (typeof document.compatMode != 'undefined' && document.compatMode != 'BackCompat') {
                        scrollPos = document.documentElement.scrollTop;
                    }
                    else if (typeof document.body != 'undefined') {
                        scrollPos = document.body.scrollTop;
                    }
                    if (scrollPos == 0) {
                        $("#downPull").show().children("span").text("正在刷新")
                        //设置滑块回弹时间
                        fn.setTranslition(1);
                        fn.translate(offset * 2);
                        if (typeof callback == "function") {
                            callback.call(fn, e);
                        }
                    }
                    //执行回调函数

                } else {
                    //返回初始状态
                    fn.back();
                }
            }
        });
    }
    function mask(imgSrc){
<<<<<<< HEAD

        var str='<div class="mask_box" style="position:fixed;top:0;left:0;width: 100%;z-index:1000;height: 100%;background: rgba(0,0,0,0.5);">'
=======
<<<<<<< HEAD
        var str='<div class="mask_box" style="position:fixed;top:0;left:0;z-index:1000;width: 100%;height: 100%;background: rgba(0,0,0,0.5);">'
=======
        var str='<div class="mask_box" style="position:fixed;top:0;left:0;width: 100%;z-index:1000;height: 100%;background: rgba(0,0,0,0.5);">'
>>>>>>> 6f889bf9db5a0398793140d3c4c50bade1440daa
>>>>>>> 578461928cc1433298078ad342be0bc85ef09e36
            +'<div style="text-align:center;width: 5rem;height:6rem;padding: 0.2rem;border-radius: 0.1px;background: #FFFFFF;margin:auto;position: absolute;left:0;right: 0;top: 0;bottom: 0;">'
            +'<h4 onclick="removeMask(this)" style="text-align:right;">'
            +'<img src="/static/index/img/icon-close.png" style="width:0.4rem;height:0.4rem;">'
            +'</h4>'
            +'<h3 style="font-weight: 600;text-align: center;font-size:0.32rem;color: #000000;margin-bottom: 0.3rem;">↓点击二维码长按添加客服为好友↓</h3>'
            +'<img style="width: 90%;" src="'+imgSrc+'">'
            +'</div>'
            +'</div>';
        $("body").append(str)
    }

    function removeMask(that){
        $(that).parents(".mask_box").remove()
    }
